Skip to content

INT-4520 Make IntegrationGraphServer customizable #2608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 24, 2018

Conversation

artembilan
Copy link
Member

Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stiuff

/**
* Get beans for provided type from the application context.
* This method can be extended for some custom logic, e.g. get beans
* form the parent application context as well.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo form

for the provided type

* @param value the value of the property
* @since 5.1
*/
public void addProperty(String name, Object value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null checks?

@@ -147,6 +147,25 @@ It is also used in the `links` element to represent a relationship (connection)
The `input` and `output` attributes are for the `inputChannel` and `outputChannel` properties of the `AbstractEndpoint`, `MessageHandler`, `SourcePollingChannelAdapter`, or `MessageProducerSupport`.
See the next section for more information.

Starting with version 5.1, the `IntegrationGraphServer` accepts a `Function<NamedComponent, Map<String, Object>> additionalPropertiesCallback` for population additional properties on the `IntegrationNode` for particular `NamedComponent`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for population of additional

for a particular

@@ -147,6 +147,25 @@ It is also used in the `links` element to represent a relationship (connection)
The `input` and `output` attributes are for the `inputChannel` and `outputChannel` properties of the `AbstractEndpoint`, `MessageHandler`, `SourcePollingChannelAdapter`, or `MessageProducerSupport`.
See the next section for more information.

Starting with version 5.1, the `IntegrationGraphServer` accepts a `Function<NamedComponent, Map<String, Object>> additionalPropertiesCallback` for population additional properties on the `IntegrationNode` for particular `NamedComponent`.
For example you can expose a `SmartLifecycle` `autoStartup` and `running` properties into the target graph:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expose the ...

@@ -210,3 +210,9 @@ e.g. `org.springframework.integration:type=MessageChannel,` `name="input#foo.myG

It is now simpler to customize the standard Micrometer meters created by the framework.
See <<micrometer-integration>> for more information.

[[x51.-integration-graph]]
=== The Integration Graph Customization
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove The.

@@ -76,6 +81,27 @@ public Stats getStats() {
return this.properties.size() == 0 ? null : this.properties;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nullable on this getter? Or, maybe we should just always return it, even if empty.

Also, now that we have a mechanism to modify the map, maybe we should return an UnmodifableMap - if so, it should be a field instead of wrapping the map on every call.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean we should use a BiConsumer<NamedComponent, Map<String, Object>> instead of that Function for additional properties?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

No; I just mean that now we have IN.addProperty() and addProperties() we no longer need to expose a direct reference to properties field.

@garyrussell garyrussell merged commit 90ac259 into spring-projects:master Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants